package com.design.cjm.behavioral.chainofresponsibility.example;

/**
 * @Author: Jie Ming Chen
 * @Date: 2018/9/25
 * @Version 1.0
 */
public class ConcreteHandler2 extends Handler{

    @Override
    public void handleRequest(int request) {

        if (request >= 20 && request < 30) {

            System.out.println("处理20到30的请求");
        } else if (successor != null) {

            // 转移到下一位
            successor.handleRequest(request);
        }
    }
}
